// 文件夹接口
import request from '@/utils/request';
import { setToken } from '@/utils/token-util';

//新增/修改 “摄像头文件夹”——商家_(新增不传id，修改传）
export async function saveFolder (data) {
  const res = await request.post('/business/monitorFolder/save', data)
  if (res.data.code === 2000) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

//查询 “摄像头文件夹”——商家
export async function queryFolder (data) {
  const res = await request.post('/business/monitorFolder/selectPage', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


//查询 “摄像头文件夹”——下的视频
export async function queryCameraFolder (data) {
  const res = await request.post('/business/camerajob/selectByFileId', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


//删除 “摄像头文件夹”——商家
export async function deleteFolder (data) {
  const res = await request.post('/business/monitorFolder/delete', data)
  if (res.data.code === 2000) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

//删除 “摄像头视频”——商家
export async function deleteCamerVideo (data) {
  const res = await request.post('/business/camerajob/delete', data)
  if (res.data.code === 2000) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}
